import {defaultAxios as request } from '@/utils/http/index.js';
const api = "/api/tdengine/selectTask/";


/**
 * 查询
 */
export function list(data,timeout=60000){
	return request({
		url: api + 'list',
		method: 'post',
		data,
		timeout: timeout 
	});
}

/**
 * 保存任务
 */
export function saveOrUpdate(data,timeout=60000){
	return request({
		url: api + 'saveOrUpdate',
		method: 'post',
		data,
		timeout: timeout 
	});
}

/**
 * 删除任务
 */
export function deleteById(params,timeout=12000){
	return request({
		url: api + 'delete',
		method: 'get',
		params,
		timeout: timeout 
	});
}

/**
 * 启动指定任务
 */
export function start(params,timeout=12000){
	return request({
		url: api + 'start',
		method: 'get',
		params,
		timeout: timeout 
	});
}


/**
 * 启动同组任务
 */
export function startByGroupId(params,timeout=12000){
	return request({
		url: api + 'startByGroupId',
		method: 'get',
		params,
		timeout: timeout 
	});
}

/**
 * 启动全部任务
 */
export function startAll(params,timeout=12000){
	return request({
		url: api + 'startAll',
		method: 'get',
		params,
		timeout: timeout 
	});
}

/**
 * 停止任务
 */
export function stop(params,timeout=12000){
	return request({
		url: api + 'stop',
		method: 'get',
		params,
		timeout: timeout 
	});
}

/**
 * 停止同组任务
 */
export function stopByGroupId(params,timeout=12000){
	return request({
		url: api + 'stopByGroupId',
		method: 'get',
		params,
		timeout: timeout 
	});
}

/**
 * 停止全部任务
 */
export function stopAll(params,timeout=12000){
	return request({
		url: api + 'stopAll',
		method: 'get',
		params,
		timeout: timeout 
	});
}